package edu.sctu.practice.class01.xiangkun.assign03.demotwo;

/**
 * Created by xiangkun on 2015/11/5.
 */
class ComparableCylinder extends Cylinder implements Comparable {

    ComparableCylinder(double r, double l) {
        super(r, l);
    }

    public int compareTo(Object o) {
        if (findVolume() > ((Cylinder) o).findVolume()) return 1;
        else if (findVolume() < ((Cylinder) o).findVolume()) return -1;
        else return 0;
    }

}

